eMule Client Server – documentation

Version 0.2 Alpha
2003-02-27
© by Daniel Gollub, dgollub@users.sourceforge.net

What is this?

This is a kind of a remote control for the eMule client so you can use it in a windows based network. 
You all know the problem: if you are in a network with a bunch of other users and everyone is using eMule, eDonkey, etc. the connection becomes slower and slower and in worst case useless. This is really critical if you have only a DSL or ISDN/Modem connection to the Internet.

So, what did I? I used my very old P166 w/ 256MB RAM and attached two 40 GB harddisks to it. Then I installed Win2k, WinVNC (to control the server via remote PC), Apache, MySQL, PHP, .NET-Framework, eMule and these little PHP scripts and this little program I wrote. And now everyone in the network can add eMule downloads to the queue by simply using his/her browser. eMule is only installed on this little server and so the connection to the Internet is only stressed by one P2P client. This saves bandwidth and resources of the other users.

I wrote the first version of this software during a long weekend.  

Sourceforge.net Registration Description
eMuleClient Remotecontrol Server

This project provides a small service tool and a bunch of PHP scripts for the Apache Webserver to control the eMule client software on a Windows (NT, 2000, XP) server in a LAN. So there is only one eMule client inside the LAN which stresses the connection to the Internet of this LAN and not a couple of P2P clients on each user machine.

The service tool is written in C#, the new Microsoft language which comes with the .NET Framework and it will use MySQLvia MyODBC as a backend system. This tool will run on the server with the eMule client and read new eMule/eDonkey links from the backend. It will  provide the links to the installed eMule client, which will add these links to it’s internal queue (and hopefully download them).

The PHP scripts use the same backend as the C# service tool and provide the UI for the users, so they can add/delete eMule links to/from the queue. This backend system may also enable the administrator of the server to provide statistical data for each user (what did he/she add/download/etc and when was it finished etc. pp.) (this feature is not implemented yet).

UNIX Name = emuleremotectrl

License

This project uses the LGPL license.
<http://www.opensource.org/licenses/lgpl-license.php>
Comments

My machine, as said above, is not the most up-to-date system and you might ask yourself how it behaves/reacts/responds on user input etc. So here are the details: the system uses up 95% to 100% of the CPU resources all the time and RAM is used about 160 to 200 MB. Depends on eMule version and on how many people try to copy files from (or to) the shares.

The reaction times of the Apache are ok if no one tries to copy files from the server shares to his/her own hard disk (and even than it is not that bad).

I installed WinVNC because on the one hand the server has a broken PS/2-Port so the keyboard doesn’t work all the time. On the other hand I don’t need a extra monitor etc. for it and I can put the box into the darkest place of my cellar and control it from my small little office .

BTW: the source code is full of German identifiers, comments, text etc. I was just to lazy to translate it. Maybe I’ll find some time for it later. If you want to translate it, be my guest.

IMPORTANT: this software is sometimes called “service” or “server” but it consists only of one exe plus a dll and several php scripts and it neither installs a real windows service nor does it need a server version of Windows!

Version history

Alpha 0.2b – 02/26/2003

	Service tool:
	new
-	eMule now can be started automatically (you have to configure this in the options)
-	newfiles.txt for every user with the newest files listed inside (is created in the user dir under the incoming dir)

changes
-	changed log file format
-	no more 3rd party dll – now uses a self made dll for reading/writing ini files

Web front-end:
changes
-  bug fixes in inc.db_func.php and inc.constants.php (no more use of _ENV[COMPUTERNAME], instead a global constant is used – you have to set this to the proper computer name on which eMule runs!)

Alpha 0.2 – 02/26/2003
	
Service tool: 
new
-	users can be added/edited
-	more statistics (+statistics for web page)
-	downloaded files can now be stored in the user directory for the user who added the link
-	downloaded files can now be moved to a trash directory after n days
-	downloaded files can now be erased after n*2 days
-	new logging files
-	About dialog

Web front-end:
new
-	support for multiple languages
-	more statistics
-	sorting columns in link list page
-	…

Alpha 0.1 – 02/18/2003

-	first version

Requirements

Minimum: 
-	Win98
-	.NET Framework Redist. 1.0
-	ODBC .NET Data provider 1.0
-	MDAC 2.7
-	Internet Explorer 6.0
-	Database
-	Webserver
-	PHP
-	ODBC drivers for database
-	eMule 
-	TCP/IP

Recommended:
-	Windows 2000 Professional/Server inc. SP3 (because it’s more stable than Win98 (SE) or WinME) 
-	.NET Framework Redist. 1.0
-	ODBC .NET Data provider 1.0
-	MDAC 2.7
-	Internet Explorer 6.0 SP1
-	MySQL 
-	Apache 
-	PHP 
-	MyODBC
-	eMule 0.26 (I’ve not tested any prior version – do it on your own risk!)
-	WinVNC or something similar (e.g. PCDuo, PC Anywhere, Terminalservices)
-	TCP/IP and UDP port forwarding from your router (because of the HighID/LowID stuff)

My system:
-	Win2k Prof w/ SP3
-	.NET Framework Redist. 1.0
-	ODBC .NET Data provider 1.0
-	MDAC 2.7
-	Internet Explorer 6.0 SP1
-	MySQL 3.23.52
-	Apache 1.3.27
-	PHP 4.3.0
-	MyODBC 3.51.05
-	eMule 0.26d
-	TCP/IP and UDP (Port(TCP) 4662, Port(UDP) 4672) port forwarding from router to server
-	WinVNC http://www.uk.research.att.com/vnc/ (to administrate the server from a remote pc)

Installation

First of all: I will not answer any question of how to install Windows, .NET Framework, MDAC, IE6, MySQL, Apache, PHP, ODBC, MyODBC or eMule. And I won’t tell you how to install a network, configure shares/users or even your portforwarding on your router etc.! There are plenty of very good documentations, HowTos and FAQs out there in the net. Just use <putinyourfavouritesearchengineonthenet;myishttp://groups.google.com> and look for it – you will find answers to your questions!

Second: Sorry, I don’t have time to give a full installation instruction right now but here is a brief one anyway.

I expect your Apache runs and PHP is enabled as MySQL and MyODBC are! If not, install and configure it now! If the .NET Framework is not installed (and the ODBC.NET driver) than what are you waiting for? Christmas? Go ahead and install it .

I also expect that your network is running, you have installed eMule on the server and that you have made a shares for the incoming files so everyone in the network can access it. If not, why do you want to install this software? Got bored or what? 

Now let’s go!

Create a new database and add the needed tables (or execute the emule.sql script file, that will do it for you). If you need a good front-end for administrating your MySQL server look out for MySQL-Front 2.5 http://www.anse.de/mysqlfront/ or http://mysqlfront.venturemedia.de/!

Create a DSN entry for the database you’ve just created and use the MyODBC driver for it!

Put the com.gotdotnet.Kozlowski.Robert.INIEdit.dll and eMuleClientServer.exe into one directory of your server where eMule is installed. Now run the eMuleClientServer.exe and go to the configuration dialog (see below).

Then you can run the program by selecting “Start service” from the menu. Make sure the eMule client is already running! In this early version of this tool it will not start up eMule automatically. This will be part of a future version.

After you have started this tool, you should see a symbol in the system tray. If not, please make sure you have a valid config.ini file in the same directory. If this still does not seem to help, please give me a note and the send in the error.log file to my eMail address.
Configuration dialog 

Please fill out all directory information. You must enter the eMule program directory as well as the eMule incoming and temp directory (if you check the little checkbox in this groupbox the dialog will do that for you if you’ve entered the correct path to the eMule program directory).

Remark: You should install your eMule client program and this tool onto the drive on which the operating system is installed. And your incoming and temp directories should be placed each on a separate hard disk. My configuration is exactly like this: eMule is installed on E:\Programme\eMule, this tool is located in E:\Programme\eMule\server, the incoming directory is under C:\emule_incoming and the directory for the temp. files is on D:\emule_temp. The operating system is installed on E:\winnt!

The directory for the deleted files (= our own little trash bin, not the windows trash folder!), if you enable this option (it is enabled if N has a value greater than 0, otherwise it is turned off), should also be placed on a separate hard disk. Attention: all files in all subdir under the incoming dir will be removed to this trash bin after the given value of days! The files will stay in the trash folder for another value of days and then they will be deleted. Please make sure the user account, under which you start this tool and eMule, has the right to move, kill, edit and create files in all mentioned directories!

Copy finished files into separate user dirs?
If you have this option enabled, than every time eMule finishes a file this tool will copy it to a subdirectory which will be named after the users login name who put the file into the queue via the web UI. You should share the user folder for the specific user only, so no one else can get his/her files! If you don’t want this, than you have just to share the incoming folder so everyone can access everyone’s else files.

Copy finished files into separate subdirectories for each file extension?
If you have this option enabled, than every time eMule finishes a file this tool will copy it to a subdirectory which will be named after the file extension. If you use this option together with the users directories then the directory for the file extension will be created in the user directory!

… still under construction ….
Yes, still under construction even if this is already Alpha 2!